<template>
	<view>
		<meInfo></meInfo>
		<view class="me-container">
			<view class="me-item" @tap="myOrder">
				<img src="http://image.ruanchaomin.com/image20200614200250.png">我的订单
			</view>
			<view class="me-item">
				<img src="http://image.ruanchaomin.com/image20200614195531.png">会员中心
			</view>
			<view class="me-item">
				<img src="http://image.ruanchaomin.com/image20200614200039.png">我的优惠
			</view>
			<view class="me-item">
				<img src="http://image.ruanchaomin.com/image20200614200123.png">礼品码兑换
			</view>
			<view class="me-item">
				<img src="http://image.ruanchaomin.com/image20200614200203.png">设置
			</view>
		</view>

	</view>
</template>

<script>
	import {mapState} from "vuex"
	import meInfo from "@/components/me-info.vue"
	export default {
		data() {
			return {
				orderList:{}
			}
		},
		components: {
			meInfo
		},
		computed:{
			...mapState("me",["userInfo"])
		},
		methods: {
			myOrder(){
			uni.navigateTo({
				animationType: 'slide-in-left',
				animationDuration: 300,
				url: "../../components/my-order?orderList="+encodeURIComponent(JSON.stringify(this.orderList))
			})
			}
		},
		onLoad() {
			console.log(this.userInfo)
			uni.request({
				
				url: this.$apiServer+"api/myOrder",
				data:{ openid:this.userInfo.openId},
				success: (res) => {
					
					this.orderList=res.data.message;
					console.log(this.orderList)
				}
			})
		}
	}
</script>

<style>
	.me-container {}

	.me-item {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		font-size: 22px;
		padding: 25px;
		border-bottom: solid 1px rgba(143, 143, 143, 0.2);

	}

	img {
		width: 32px;
		margin-right: 5px;

	}
</style>
